home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tiger Disk 43
/
Tiger_Disk_043_1997-10_Tiger-Crew-Disk_de_Side_A.d64
/
basic mandelbrot
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
1KB
|
53 lines
2 rem mandelbrot-beispielprogramm
4 rem ---------------------------
6 rem (c) marc 'blackjack' rintsch
8 rem (p) tiger disk in 1997
10 rem
12 x1 = -2 :rem real-min
14 x2 = 2 :rem real-max
16 y1 = -2 :rem imaginaer-min
18 y2 = 2 :rem imaginaer-max
20 :
22 mt = 15 :rem rekursionstiefe
24 :
26 cr = x1:rem ausgangswert fuer
28 ci = y1:rem die konstante c
30 :
32 dx = (x2-x1)/39:rem additions-
34 dy = (y2-y1)/24:rem konstanten
36 :
38 dim c(4):rem farben festlegen
40 c(0)=6:c(1)=4:c(2)=14:c(3)=3:c(4)=1
42 :
44 rem bildschirm mit "[209]" fuellen
46 print "[151][147]";
48 poke 53280,0
50 poke 53281,0
52 for y=0 to 999
54 poke 1024+y,81
56 next
58 :
60 ti$="000000":rem stoppuhr auf 0
62 :
64 for y=0 to 24
66 for x=0 to 39
68 t=0:r=0:i=0
70 rh = (r * r - i * i) + cr
72 ih = 2 * r * i + ci
74 r = rh
76 i = ih
78 if (r*r+i*i)>4 then86
80 t=t+1
82 if t=mt then c=0:goto88
84 goto70
86 c=c(t-int(t/5)*5)
88 poke 55296+y*40+x,c
90 cr=cr+dx
92 next
94 ci=ci+dy
96 cr=x1
98 next
100 xx=ti/60
102 print "zeit:";xx;"sek."
104 poke 198,0:wait 198,1